const readline = require("readline");
const fs = require("fs");

const rl = readline.createInterface({
  input: fs.createReadStream("./yarn.lock.txt"),
});

// 文件行数
let lineNum = 0;

// 读取
rl.on("line", function (line) {
  console.log(line.toString());
  lineNum++;
});

// 读取完毕
rl.on("close", function () {
  console.log("lineNum ~ ", lineNum);
});
